//
//  SEGActivityDetailNoCommentCell.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/8/4.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGActivityDetailNoCommentCell.h"

@implementation SEGActivityDetailNoCommentCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    self.backgroundColor = kColor_W;
    
    SEGAdjustableButton *button = [[SEGAdjustableButton alloc] init];
    [button setTitle:@"第一条邻居说归您啦" forState:UIControlStateNormal];
    [button setTitleColor:kColor_1 forState:UIControlStateNormal];
    [button setImage:[UIImage imageWithContentsOfFile:SEGPicName(@"icon_edit")] forState:UIControlStateNormal];
    button.titleLabel.font = kFont_13;
    button.layer.masksToBounds = YES;
    button.layer.cornerRadius = 1;
    button.layer.borderWidth = 1;
    button.layer.borderColor = kColor_L2.CGColor;
    [button addTarget:self action:@selector(seg_buttonPressed) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:button];
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.width.mas_equalTo(160);
        make.height.mas_equalTo(30).priorityHigh();
        make.top.equalTo(self.contentView).offset(20);
        make.bottom.equalTo(self.contentView).offset(-20);
    }];
    [button layoutButtonWithEdgeInsetsStyle:SEGButtonEdgeInsetsStyleLeft imageTitleSpace:5];
}

- (void)seg_buttonPressed
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(noCommentButtonClick)]) {
        [self.delegate noCommentButtonClick];
    }
}

@end
